<!-- BEGIN PAGE HEADER-->
<?php

$this->load->view('partials/breadcrumb.tpl') ?>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<script language="javascript">
    function defConfirm(url) {
        if (!confirm("确定要删除吗？")) {
            return false;
        }
        window.location.href = url;
        return true;
    }

    $(document).ready(function () {
        $("#reset").click(function () {
            $("select").val('');
            $("input[type='text']").val('');
        });

    });

    function op_check() {
        var selObj = $("#user_op")[0];
        if (selObj.selectedIndex < 1) {
            alert("请选择操作！");
            return false;
        }
        var allUnChecked = true;
        var checkBoxList = $("input[name^='id_time']");
        for (var i = 0; i < checkBoxList.length; i++) {
            if (checkBoxList[i].checked) {
                allUnChecked = false;
                break;
            }
        }
        if (allUnChecked) {
            alert("请选择要操作的用户！");
            return false;
        }
        if (!confirm("确定要 " + $("#user_op").find("option:selected").html() + " 选中的用户么？")) {
            return false;
        }
        $("#user_mng_frm").submit();
    }

    $(document).ready(function () {
        $("#checkall").on('click', function () {
            var ck = $(this).is(":checked");
            var checkBoxList = $("input[name^='id_time']");
            for (var i = 0; i < checkBoxList.length; i++) {
                checkBoxList[i].checked = ck;
                $(checkBoxList[i]).uniform();
            }
        });
    });
</script>
<div class="row">
    <div class="col-xs-12">
        <!-- Begin: life time stats -->
        <div class="portlet light">
            <div class="portlet-title portlet-title-noborder">
                <?= form_open('', Array('class' => 'form-inline', 'role' => 'form')) ?>
                <?= search_form_input('name', filterValue('name'), '刷手名称'); ?>
                <?= search_form_input('account', filterValue('account'), '刷手账户'); ?>
                <?= search_form_dropdown('type', array('' => '刷手类型')+MShuadanshou::getType(), filterValue('type'), '刷手类型', 'class="form-control input-small" '); ?>
                <?= search_form_dropdown('status', array('' => '状态')+MShuadanshou::getState(), filterValue('status'), '状态', 'class="form-control input-small" '); ?>
                <div class="input-group input-large date-picker input-daterange" data-date="" data-date-format="yyyy-mm-dd">
                    <input type="text" class="form-control" name="shuandanshou_create_time_begin"
                           value="<?= filterValue('shuandanshou_create_time_begin') ?>" placeholder="开始时间" autoComplete="off">
                    <span class="input-group-addon">to </span>
                    <input type="text" class="form-control" name="shuandanshou_create_time_end"
                           value="<?= filterValue('shuandanshou_create_time_end') ?>" placeholder="结束时间" autoComplete="off">
                </div>
                <button type="button" class="btn default" id="reset">重置条件</button>
                <button type="submit" class="btn green about_search">搜索 <i class="fa fa-search"></i></button>
                <?= form_close() ?>
            </div>
            <div class="portlet-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="table-scrollable">
                            <table class="table table-hover table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th width="5%">ID</th>
                                    <th width="10%">刷手名称</th>
                                    <th width="5%">类型</th>
                                    <th width="5%">所属人</th>
                                    <th width="15%">收款账号</th>
                                    <th width="20%">账号详情</th>
                                    <th width="10%">评分</th>
                                    <th width="5%">状态</th>
                                    <th width="20%">创建时间</th>
                                    <th width="10%">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php
                                foreach ($list as $v) {
                                    ?>
                                    <tr>
                                        <td><?= $v->id ?></td>
                                        <td><?= htmlspecialchars($v->name) ?></td>
                                        <td><?= MShuadanshou::getType()[$v->type] ?></td>
                                        <td><?= htmlspecialchars($v->aname) ?></td>
                                        <td><?= htmlspecialchars($v->account) ?></td>
                                        <td><?= htmlspecialchars($v->account_desc) ?></td>
                                        <td><?= htmlspecialchars($v->reviews) ?></td>
                                        <td><?= ($v->status == 1 ? '<span class="label label-success">正常</span>' : '<span class="label label-warning">不可用</span>') ?></td>
                                        <td><?php echo date('Y-m-d H:i:s', $v->create_time) ?></td>
                                        <td>
                                            <div class="btn-group btn-group-solid">
                                                <?php if ($p->edit) { ?>
                                                <a href="<?= site_url($thisModule . $thisController . '/edit/' . $v->id) ?>"
                                                   class="btn btn-sm purple">
                                                        <i class="fa fa-edit"></i> 编辑</a><?php } else {
                                                    echo '&nbsp;';
                                                } ?>
                                            </div>
                                        </td>
                                    </tr>
                                <?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12 text-right">
                        <?= $pagination ?>
                    </div>
                </div>
            </div>
        </div>
        <!-- End: life time stats -->
    </div>
</div>
<!-- END PAGE CONTENT-->
